<template>
	<!-- #ifdef H5||APP-PLUS  -->
	<view style="position:relative">
		<view class="bar">
			<view class="flLet">
				<img v-if="!show" src="../../static/img/info.png" alt="" @click="open" v-show="backBtnShow">
				<img v-if="show" src="../../static/tian/close.png" alt="" @click="open" v-show="backBtnShow">
			</view>
			<view class="flCon">
				{{title}}
			</view>
			<view class="fright" v-if="ids == 0">
				<img v-if="$i18n.locale == 'ft'" src="../../static/img/zh.png" alt="" @click="open2" v-show="timeBtnShow">
				<img v-if="$i18n.locale == 'en'" src="../../static/img/en.png" alt="" @click="open2" v-show="timeBtnShow">
				<img v-if="$i18n.locale == 'jp'" src="../../static/img/rb.png" alt="" @click="open2" v-show="timeBtnShow">
				<img v-if="$i18n.locale == 'ko'" src="../../static/img/hg.png" alt="" @click="open2" v-show="timeBtnShow">
				<img v-if="$i18n.locale == 'zh'" src="../../static/img/zh.png" alt="" @click="open2" v-show="timeBtnShow">
			</view>
			<view class="fright" v-if="ids == 1">
				<img src="../../static/tian/lishi.png" alt="" @click="open3" v-show="timeBtnShow">
			</view>
		</view>
		<view style="height: 80rpx;"></view>
		<view class="mask" v-if="show">
			<silde style="width: 60%;"  @getMsg="openMsg" />
			<view style="width: 40%;" @click="show = false"></view>
		</view>
		<view class="mask2" v-if="show2">
			<view @click="lang('en')">
				<img src="../../static/img/en.png" alt="">
				<text>English</text>
			</view>
			<view @click="lang('ft')">
				<img src="../../static/img/zh.png" alt="">
				<text>港澳繁體</text>
			</view>
			<view @click="lang('zh')">
				<img src="../../static/img/zh.png" alt="">
				<text>中文简体</text>
			</view>
			<view @click="lang('jp')">
				<img src="../../static/img/rb.png" alt="">
				<text>にほんご</text>
			</view>
			<view @click="lang('ko')">
				<img src="../../static/img/hg.png" alt="">
				<text>한국어</text>
			</view>
		</view>
	</view>
	<!-- #endif -->
</template>

<script>
	import silde from './sidebar.vue'
	export default {
		components: {
			silde
		},
		props: {
			title: {
				type: String,
				default: '标题'
			},
			backBtnShow: {
				type: Boolean,
				default: true
			},
			timeBtnShow: {
				type: Boolean,
				default: true
			},
			ids: {
				type: String,
				default: '0'
			},
		},
		data() {
			return {
				show: false,
				show2: false
			}
		},
		onLoad() {
		},
		methods: {
			openMsg(msg) {
				this.show = false;
			},
			open() {
				this.show = !this.show
			},
			open2() {
				this.show2 = !this.show2
			},
			lang(e){
				this.$i18n.locale = e;
				localStorage.setItem('lang',e);
				this.show2 = false;
			},
			open3(){
				this.$emit("send","我来自子组件")
			}
		},
		onShow() {
			
		},
	}
</script>

<style>
	.mask {
		position: fixed;
		width: 100%;
		height: 100vh;
		top: 80rpx;
		z-index: 999;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		border-bottom-right-radius: 50rpx;
	}

	.mask2 {
		position: fixed;
		top: 80rpx;
		right: 30rpx;
		z-index: 99;
		background-color: #ffffff;
		border-radius: 50rpx;
		padding: 10rpx 30rpx;
		font-size: 24rpx;
	}

	.mask2 img {
		width: 44rpx;
		height: 44rpx;
		margin-right: 30rpx;
	}


	.mask2 view {
		display: flex;
		align-items: center;
		margin: 20rpx;
	}

	.bar {
		width: 100%;
		height: 80rpx;
		position: fixed;
		top: 0;
		background-color: #ecf0f5;
		display: flex;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
		z-index: 999;
	}

	.bar img {
		width: 44rpx;
		height: 44rpx;
	}

	.bar .flCon {
		font-size: 38rpx;
		font-weight: 600;
		color: #222;
	}

	.flLet img {
		margin-left: 40rpx;
	}

	.fright img {
		margin-right: 40rpx;
	}
</style>